from sqlalchemy.orm import Session

from app.models.nav_bar import NavBar
from app.schemas.nav_bar import NavBarVo


def nav_bar_list(db: Session) -> list[NavBarVo]:
    """查询列表"""
    nav_bar_do_list = db.query(NavBar).filter(NavBar.is_delete == 0).all()
    return [
        NavBarVo.model_validate(nav_bar) for nav_bar in nav_bar_do_list
    ]
